package org.imast.actions;

import java.util.ArrayList;
import java.util.List;

import org.imast.models.ModelCustomer;
import org.imast.services.ServiceCustomer;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

public class ActionCustomers extends ActionSupport implements ModelDriven<ModelCustomer>{
	
	private ModelCustomer customer = new ModelCustomer();
	private List<ModelCustomer> listCustomer = new ArrayList<ModelCustomer>();
	private ServiceCustomer serviceCustomer = new ServiceCustomer();
	
	public String getAll(){
		
		listCustomer = serviceCustomer.getAll();
		
		return SUCCESS;
		
	}

	public ModelCustomer getCustomer() {
		return customer;
	}

	public void setCustomer(ModelCustomer customer) {
		this.customer = customer;
	}

	public List<ModelCustomer> getListCustomer() {
		return listCustomer;
	}

	public void setListCustomer(List<ModelCustomer> listCustomer) {
		this.listCustomer = listCustomer;
	}

	@Override
	public ModelCustomer getModel() {
		// TODO Auto-generated method stub
		return customer;
	}

}
